package studia.figlewicz.dao.ejb;

// Generated 2011-06-03 08:31:30 by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Korelacja generated by hbm2java
 */
@Entity
@Table(name = "KORELACJA", schema = "MARCIN")
public class Korelacja implements java.io.Serializable {

	private KorelacjaId id;
	private Model modelBySysC004110;
	private Model modelBySysC004109;
	private BigDecimal wartosc;

	public Korelacja() {
	}

	public Korelacja(KorelacjaId id, Model modelBySysC004110,
			Model modelBySysC004109) {
		this.id = id;
		this.modelBySysC004110 = modelBySysC004110;
		this.modelBySysC004109 = modelBySysC004109;
	}

	public Korelacja(KorelacjaId id, Model modelBySysC004110,
			Model modelBySysC004109, BigDecimal wartosc) {
		this.id = id;
		this.modelBySysC004110 = modelBySysC004110;
		this.modelBySysC004109 = modelBySysC004109;
		this.wartosc = wartosc;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "modelpierwszy", column = @Column(name = "MODELPIERWSZY", nullable = false, length = 50)),
			@AttributeOverride(name = "wersjamodelupierwszego", column = @Column(name = "WERSJAMODELUPIERWSZEGO", nullable = false, precision = 22, scale = 0)),
			@AttributeOverride(name = "modeldrugi", column = @Column(name = "MODELDRUGI", nullable = false, length = 50)),
			@AttributeOverride(name = "wersjamodeludrugiego", column = @Column(name = "WERSJAMODELUDRUGIEGO", nullable = false, precision = 22, scale = 0)) })
	public KorelacjaId getId() {
		return this.id;
	}

	public void setId(KorelacjaId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "MODELDRUGI", referencedColumnName = "NAZWA", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "WERSJAMODELUDRUGIEGO", referencedColumnName = "NUMERWERSJI", nullable = false, insertable = false, updatable = false) })
	public Model getModelBySysC004110() {
		return this.modelBySysC004110;
	}

	public void setModelBySysC004110(Model modelBySysC004110) {
		this.modelBySysC004110 = modelBySysC004110;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "MODELPIERWSZY", referencedColumnName = "NAZWA", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "WERSJAMODELUPIERWSZEGO", referencedColumnName = "NUMERWERSJI", nullable = false, insertable = false, updatable = false) })
	public Model getModelBySysC004109() {
		return this.modelBySysC004109;
	}

	public void setModelBySysC004109(Model modelBySysC004109) {
		this.modelBySysC004109 = modelBySysC004109;
	}

	@Column(name = "WARTOSC", precision = 24, scale = 12)
	public BigDecimal getWartosc() {
		return this.wartosc;
	}

	public void setWartosc(BigDecimal wartosc) {
		this.wartosc = wartosc;
	}

}
